package cn.edu.klmy.controller;

import cn.edu.klmy.dao.ICatalogDao;
import cn.edu.klmy.models.menu.AuthorityCatalog;
import cn.edu.klmy.models.menu.Catalog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 目录树控制器
 *
 * @author 顾伟
 *         创建日期：13-4-8
 */
@Controller
@RequestMapping("/catalog")
public class CatalogController {

    @Autowired
    private ICatalogDao catalogDao;

    @RequestMapping("/list/role")
    @ResponseBody
    public  List<AuthorityCatalog> loadRoleCatalogs(@RequestParam int roleId) {
        List<AuthorityCatalog> catalogList = catalogDao.getRoleCatalog(roleId);
        return catalogList;
    }
}
